Optical codes, such as barcodes and other machine-readable indicia, appear in various places in a variety of applications. There are a variety of such optical codes, including 1D or linear barcodes (e.g., UPC code), 2D codes including stacked linear barcodes (e.g., PDF-417 code), and matrix codes (e.g., Datamatrix code, QR code, or Maxicode). Businesses have begun sending electronic versions of optical codes to customers who display such optical codes on a portable electronic device, such as a mobile telephone, personal digital assistant, palm, tablet, or laptop computer, or other suitable device having an electronic display, such as a liquid crystal display (LCD). For example, an airline passenger may display an optical code on a portable electronic device for an airline employee to read using a data reader as verification of the passenger's ticket. In another example, a customer in a store may display an optical code on a portable electronic device for a cashier to read using a data reader to redeem a coupon. Optical codes are also included on other items having highly, or relatively highly, reflective surfaces, for example, but not limited to, identification (ID) cards, aluminum cans, and objects in plastic packaging.